#ifndef LING_UI_HPP_INCLUDED
#define LING_UI_HPP_INCLUDED
/////////////////////////////
//implement UiInterface
////////////////////////////
#include "UiInterface.h"

template< class WinImpl>
class Ui:public UiInterface
{    
public:
    Ui(){
        impl_ = static_cast<WinImpl*>(this);
    }
    
    void StartTimer(){
        impl_->StartTimer();
    }
    void StopTimer(){
       impl_->StopTimer();
    }


    void SetFileInfo(const std::wstring& file_name, long file_length){
        impl_->DrawFileName(file_name);
        impl_->bar_.SetLength(file_length);
    }

    void StartPlay(long pos){
        impl_->bar_.StartPlay(pos);
    }
    void UpdateNormalPlayingStatus( long pre_pos, long new_pos){
        impl_->bar_.UpdateNormalPlayingPosition(pre_pos, new_pos);
    }

    void SetStartPos(long pos){
        impl_->bar_.SetStartPos(pos);
    }

    void SetEndPos(long pos){
        impl_->bar_.SetEndPos(pos);
    }


    void UpdateRepeatedPlayingStatus(long pre_pos, long new_pos){
        impl_->bar_.UpdateRepeatedPlayingPosition(pre_pos, new_pos);
    }
    void ContinuePlay(){}

    void StartRepeat(){
        impl_->bar_.StartRepeat();
    }

    void Repaint(){}
private:
    WinImpl* impl_;
};
#endif
